<% if tabs.length > 0 %>
  <div class="layout-main__section" data-controller="accordion" data-multiselectable="false" data-collapsible="false">
    <ul class="tab-x-container tabs-<%= tabs.length %>">
      <% tabs.each_with_index do |tab, i| %>
        <li>
          <button type="button" id="trigger-<%= tab[:id] %>" class="tab-x" data-controls="panel-<%= tab[:id] %>" data-open="<%= "true" if selected?(tab, i) %>">
            <%= icon tab[:icon], class: "text-gray fill-current" %><%= tab[:text] %> <% "tabs-1" %>
          </button>
        </li>
      <% end %>
    </ul>

    <% panels.each do |panel| %>
      <div id="panel-<%= panel[:id] %>" class="py-8">
        <%= send(panel[:method], *panel[:args]) %>
      </div>
    <% end %>
  </div>
<% end %>
